package com.yh.yh_newdialer;

import android.support.v7.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final Button button=(Button)findViewById(R.id.Button01);
        button.setOnClickListener(new Button.OnClickListener(){
                                      public void onClick(View b){

                                          Intent intent = new Intent(Intent.ACTION_VIEW);
                                          intent.setData(Uri.parse("http://www.baidu.com"));
                                          startActivity(intent);
                                      }

                                  }
        );
    }
}
